#include <stdio.h>

unsigned char calculateXORChecksum(unsigned char* data, int length) {
    unsigned char checksum = 0;
    for (int i = 0; i < length; i++) {
        checksum ^= data[i];
    }
    return checksum;
}

int main() {
    unsigned char data[] = {0x55, 0xA3, 0x00, 0x04, 0x88, 0x09, 0x00, 0x00};
    int length = sizeof(data) / sizeof(data[0]);
    unsigned char checksum = calculateXORChecksum(data, length);
    printf("XOR Checksum: 0x%02X\n", checksum);
    return 0;
}